<?php	

class activities extends Controller
{
	
	public function register()
	{
		$this->session();
		$model = new registration();
		$register = $model->insertReg( $_POST['eventId'], $_POST['orgId'],$_SESSION['stud_no'] ); 
		$message = 'You have been registered for this event.
		Click <a href="/members/orgs/' . $_SESSION['orgname'] . '/activities">here</a> to go back.' ;
		new View('emptyTemplate', array( 'message' => $message )) ;
	}

	public function comment()
	{
		$this->session();
		$model = new commentevent();
		$date = gmdate ( 'YmdHis' );
		$comment = $model->insertComment($_POST['eventId'],$_SESSION['stud_no'], $date, $_POST['comment'] ); 
		$message = 'Your message has been posted.
		Click <a href="/members/orgs/' . $_SESSION['orgname'] . '/activities/' . $_POST['eventId'] . '">here</a> to go back.' ;
		new View('emptyTemplate', 
		array( 'message' => $message )) ;	
	}

}

